# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Blogger.V3.Model.Post do
  @moduledoc """


  ## Attributes

  *   `author` (*type:* `GoogleApi.Blogger.V3.Model.PostAuthor.t`, *default:* `nil`) - The author of this Post.
  *   `blog` (*type:* `GoogleApi.Blogger.V3.Model.PostBlog.t`, *default:* `nil`) - Data about the blog containing this Post.
  *   `content` (*type:* `String.t`, *default:* `nil`) - The content of the Post. May contain HTML markup.
  *   `customMetaData` (*type:* `String.t`, *default:* `nil`) - The JSON meta-data for the Post.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Etag of the resource.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The identifier of this Post.
  *   `images` (*type:* `list(GoogleApi.Blogger.V3.Model.PostImages.t)`, *default:* `nil`) - Display image for the Post.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - The kind of this entity. Always blogger#post.
  *   `labels` (*type:* `list(String.t)`, *default:* `nil`) - The list of labels this Post was tagged with.
  *   `location` (*type:* `GoogleApi.Blogger.V3.Model.PostLocation.t`, *default:* `nil`) - The location for geotagged posts.
  *   `published` (*type:* `String.t`, *default:* `nil`) - RFC 3339 date-time when this Post was published.
  *   `readerComments` (*type:* `String.t`, *default:* `nil`) - Comment control and display setting for readers of this post.
  *   `replies` (*type:* `GoogleApi.Blogger.V3.Model.PostReplies.t`, *default:* `nil`) - The container of comments on this Post.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - The API REST URL to fetch this resource from.
  *   `status` (*type:* `String.t`, *default:* `nil`) - Status of the post. Only set for admin-level requests.
  *   `title` (*type:* `String.t`, *default:* `nil`) - The title of the Post.
  *   `titleLink` (*type:* `String.t`, *default:* `nil`) - The title link URL, similar to atom's related link.
  *   `trashed` (*type:* `String.t`, *default:* `nil`) - RFC 3339 date-time when this Post was last trashed.
  *   `updated` (*type:* `String.t`, *default:* `nil`) - RFC 3339 date-time when this Post was last updated.
  *   `url` (*type:* `String.t`, *default:* `nil`) - The URL where this Post is displayed.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :author => GoogleApi.Blogger.V3.Model.PostAuthor.t() | nil,
          :blog => GoogleApi.Blogger.V3.Model.PostBlog.t() | nil,
          :content => String.t() | nil,
          :customMetaData => String.t() | nil,
          :etag => String.t() | nil,
          :id => String.t() | nil,
          :images => list(GoogleApi.Blogger.V3.Model.PostImages.t()) | nil,
          :kind => String.t() | nil,
          :labels => list(String.t()) | nil,
          :location => GoogleApi.Blogger.V3.Model.PostLocation.t() | nil,
          :published => String.t() | nil,
          :readerComments => String.t() | nil,
          :replies => GoogleApi.Blogger.V3.Model.PostReplies.t() | nil,
          :selfLink => String.t() | nil,
          :status => String.t() | nil,
          :title => String.t() | nil,
          :titleLink => String.t() | nil,
          :trashed => String.t() | nil,
          :updated => String.t() | nil,
          :url => String.t() | nil
        }

  field(:author, as: GoogleApi.Blogger.V3.Model.PostAuthor)
  field(:blog, as: GoogleApi.Blogger.V3.Model.PostBlog)
  field(:content)
  field(:customMetaData)
  field(:etag)
  field(:id)
  field(:images, as: GoogleApi.Blogger.V3.Model.PostImages, type: :list)
  field(:kind)
  field(:labels, type: :list)
  field(:location, as: GoogleApi.Blogger.V3.Model.PostLocation)
  field(:published)
  field(:readerComments)
  field(:replies, as: GoogleApi.Blogger.V3.Model.PostReplies)
  field(:selfLink)
  field(:status)
  field(:title)
  field(:titleLink)
  field(:trashed)
  field(:updated)
  field(:url)
end

defimpl Poison.Decoder, for: GoogleApi.Blogger.V3.Model.Post do
  def decode(value, options) do
    GoogleApi.Blogger.V3.Model.Post.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Blogger.V3.Model.Post do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
